package com.strawcom.charmring;

import java.util.Locale;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;

import com.strawcom.charmring.ui.FirstActivity;
import com.strawcom.charmring.ui.SplashActivity;

public class LauncherCtrlActivity extends BaseActivity {
	public static final String msppath = "charmring_first_launcher";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		this.isEnglish();
		
		SharedPreferences preference = context.getSharedPreferences(msppath, Context.MODE_PRIVATE);
		boolean isFristLauncher = preference.getBoolean(C.sp.is_frist_launcher, true);
		if (isFristLauncher) {
			preference.edit().putBoolean(C.sp.is_frist_launcher, false).commit();

			actionStart(SplashActivity.class);
		}
		else {
			actionStart(FirstActivity.class);
		}

		finish();
	}
	
	public void isEnglish(){
		Locale locale = this.getResources().getConfiguration().locale;
        String language = locale.getLanguage();
        System.out.println("当前系统语言环境是：" + language);
        if (language.endsWith("en"))
            C.isEnglish = true;
        else
        	C.isEnglish = false;
	}
	
}
